﻿# CMakeList.txt: thirdx 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)

project ("thirdparty")


function(AutoBuild)

	IF(CMAKE_BUILD_TYPE MATCHES "Debug" AND WIN32)
		add_definitions(-D__DEBUG__)
		add_definitions(-D__WIN32__)
		add_definitions(-DWIN32_LEAN_AND_MEAN)
		add_definitions(-D_LIB)
	ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND WIN32)
		add_definitions(-D__WIN32__)
		add_definitions(-DWIN32_LEAN_AND_MEAN)
		add_definitions(-D_LIB)
	ELSEIF(CMAKE_BUILD_TYPE MATCHES "Debug" AND UNIX)
		add_definitions(-D__DEBUG__)
		add_definitions(-D__LINUX__)
		add_definitions(-fpermissive)
	ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND UNIX)
		add_definitions(-D__LINUX__)
		add_definitions(-fpermissive)
	ENDIF()
	
	
	add_subdirectory(httplib)
	#add_subdirectory(wolfssl)
	add_subdirectory(sqlite3xx)
	add_subdirectory(movcrypto)
	add_subdirectory(tinyxml2)
	add_subdirectory(x2lib)
	
	add_library(x2lib STATIC $<TARGET_OBJECTS:x2lib_objs> $<TARGET_OBJECTS:httplib_objs> $<TARGET_OBJECTS:movcrypto_objs> $<TARGET_OBJECTS:sqlite3xx_objs> $<TARGET_OBJECTS:tinyxml2_objs>)
	
endfunction(AutoBuild)

AutoBuild()

# TODO: 如有需要，请添加测试并安装目标。
